#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(time(nullptr));
constexpr char A[][5] = {"RGGB", "RBRB", "GBRG"};
constexpr int N = 3, M = 4;
int K = 45;
string S;
bool cmp(const tuple<int, int, char> &l, const tuple<int, int, char> &r){
  int x = min(get<0>(l), K - get<0>(l) - 1) * min(get<1>(l), K - get<1>(l) - 1);
  int y = min(get<0>(r), K - get<0>(r) - 1) * min(get<1>(r), K - get<1>(r) - 1);
  return x > y;
}
string solve(int x, int y){
  string res;
  for(int i = 1; i < (int)S.size(); i++){
    vector<tuple<int, int, char>> nxt;
    if(x - 1 >= 0 && A[(x - 1) % N][y % M] == S[i]) nxt.emplace_back(x - 1, y, 'U');
    if(x + 1 <  K && A[(x + 1) % N][y % M] == S[i]) nxt.emplace_back(x + 1, y, 'D');
    if(y - 1 >= 0 && A[x % N][(y - 1) % M] == S[i]) nxt.emplace_back(x, y - 1, 'L');
    if(y + 1 <  K && A[x % N][(y + 1) % M] == S[i]) nxt.emplace_back(x, y + 1, 'R');
    sort(nxt.begin(), nxt.end(), cmp);
    if(nxt.empty()) return "";
    x = get<0>(nxt[0]), y = get<1>(nxt[0]);
    res += get<2>(nxt[0]);
  }
  cerr << K << ':' << (double)clock() / CLOCKS_PER_SEC << endl;
  return res;
}
int main(){
  freopen("snake.in", "r", stdin);
  freopen("snake.out", "w", stdout);
  cin.tie(nullptr)->sync_with_stdio(false);
  cin >> S;
  cout << K << ' ' << K << '\n';
  for(int i = 0; i < K; i++){
    for(int j = 0; j < K; j++) cout << A[i % N][j % M];
    cout << '\n';
  }
  int cnt = 0;
  while(true){
    int x = rnd() % K, y = rnd() % K;
    if(S[0] == A[x % N][y % M]){
      auto Ans = solve(x, y);
      if(S.size() < 2 || !Ans.empty()){
        cout << x << ' ' << y << '\n';
        cout << Ans << '\n';
        return 0;
      } else if(++cnt == 10) cnt = 0, K += 5;
    }
  }
  return 0;
}
